//
//  UIImage+StretchImage.m
//  TXLCodeOnly
//
//  Created by Zhu Jinxin on 16/5/18.
//  Copyright © 2016年 Zhu Jinxin. All rights reserved.
//

#import "UIImage+StretchImage.h"

@implementation UIImage (StretchImage)

+ (UIImage*)stretchImageWith:(NSString*)imageName{
    
    UIImage*MotoImg = [UIImage imageNamed:imageName];
    
    CGFloat halfWidth = MotoImg.size.width/2;
    CGFloat halfHeight = MotoImg.size.height/2;
    
    return [MotoImg resizableImageWithCapInsets:UIEdgeInsetsMake(halfHeight, halfWidth, halfHeight, halfWidth) resizingMode:UIImageResizingModeStretch];
    
}



@end
